﻿// Version:1
// Author:Sanket Naik
// Date:July-21-2010 
// Comments:
// 
// 
// 

using System;
using System.Linq;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Runtime.Serialization;
using ManagedServices.Common.DataTransferObject;

namespace ManagedServices.DataTransferObjects
{
    /// <summary>
    /// The DTO representing the DependencyType
    /// </summary>
    [DataContract]
    public class DependencyType : ICommonDto
    {
        /// <summary>
        /// The Dependency Type for AppConfig
        /// </summary>
        public static readonly DependencyType AppConfig = new DependencyType(new Guid("9F386574-2EEB-4192-B3A0-55029CF81E58"), "AppConfig", 1);

        /// <summary>
        /// The Dependency Type for Settings, these are config settings that are changeable at run-time
        /// </summary>
        public static readonly DependencyType Settings = new DependencyType(new Guid("3E02F0A3-219E-4423-B264-CF93CB79D216"), "Settings", 2);

        /// <summary>
        /// The Dependency Type for Assembly
        /// </summary>
        public static readonly DependencyType Assembly = new DependencyType(new Guid("36F195E0-66C5-49AB-9C4E-3CA8D9F0DDE7"), "Assembly", 3);

        /// <summary>
        /// The Dependency Type for Startup Assembly
        /// </summary>
        public static readonly DependencyType StartupAssembly = new DependencyType(new Guid("4C86B95E-3277-4611-9D79-F1D2B38E3445"), "StartupAssembly", 4);


        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="startModeID"></param>
        /// <param name="name"></param>
        /// <param name="code"></param>
        public DependencyType(Guid dependencyTypeID, string name, short code)
        {
            DependencyTypeID = dependencyTypeID;
            Name = name;
            Code = code;
            CreatedBy = Guid.Empty;
            ModifiedBy = Guid.Empty;
            CreatedOn = DateTime.Now;
            ModifiedOn = DateTime.Now;
        }

        /// <summary>
        /// The Guid representing the Dependency Type Uniquely
        /// </summary>
        [DataMember]
        public Guid DependencyTypeID { get; set; }

        /// <summary>
        /// The Name representing the Dependency Type 
        /// </summary>
        [DataMember]
        public string Name { get; set; }

        /// <summary>
        /// The integer representing the Dependency Type
        /// </summary>
        [DataMember]
        public short Code { get; set; }



        /// <summary>
        /// Primary key for the DTO
        /// </summary>
        public Guid KeyId { get { return DependencyTypeID; } set { DependencyTypeID = value; } }

        /// <summary>
        /// Created by the User ID
        /// </summary>
        [DataMember]
        public Guid CreatedBy { get; set; }

        /// <summary>
        /// Created By User ID
        /// </summary>
        [DataMember]
        public Nullable<Guid> ModifiedBy { get; set; }

        /// <summary>
        /// Created On
        /// </summary>
        [DataMember]
        public DateTime CreatedOn { get; set; }

        /// <summary>
        /// Modified On
        /// </summary>
        [DataMember]
        public Nullable<DateTime> ModifiedOn { get; set; }
    }
}
